package com.sarees.test;

import org.junit.Test;

import junit.framework.Assert;
import lib.app.online.DATA;

public class MisTestSuite extends BaseClass
{
	@Test
	public void contactUs()
	{

		//open contact us link
		app.goToContactUs();
		//check the default values
		//name
		Assert.assertEquals("", w.getSel().getText("id=contactname"));
		//email
		Assert.assertEquals("", w.getSel().getText("id=email-address"));
		//message
		Assert.assertEquals("", w.getSel().getText("name=enquiry"));
		////-------------SEND MESSAGE-----------///
		app.goToHomePage();
		
	}
	
	@Test
	public void sendMessage()
	{
		app.goToContactUs();
		
		sendMessage(DATA.NAME,DATA.EMAIL,DATA.MESSAGE);
		
		Assert.assertTrue(w.getSel().isTextPresent(DATA.CONFMESAGE));
	}
	
	public void sendMessage(String name,String email,String message)
	{
		//enter name
				w.getSel().type("id=contactname",name);
				//enter email
				w.getSel().type("id=email-address",email);
				//enter text
				w.getSel().type("name=enquiry",message);
				//send the message
				w.getSel().click("xpath=//input[@alt='Send Now']");
				//verify confirmation message
	}
}
